local hupo = fk.CreateSkill {
  name = "lingling__hupo",
  tags = { Skill.Compulsory }
}

Fk:loadTranslationTable{
  ["lingling__hupo"] = "虎魄",
  [":lingling__hupo"] = "锁定技，当你受到或造成伤害后，若你没有【闪】，你摸一张牌。",
}

hupo:addEffect(fk.Damaged, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(hupo.name) then
      for _, cid in ipairs(player:getCardIds("h")) do
        if Fk:getCardById(cid).trueName == "jink" then
          return false
        end
      end
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, hupo.name)
  end
})

hupo:addEffect(fk.Damage, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(hupo.name) then
      for _, cid in ipairs(player:getCardIds("h")) do
        if Fk:getCardById(cid).trueName == "jink" then
          return false
        end
      end
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, hupo.name)
  end
})

return hupo
